from model import Model


class Category(Model):
    def __init__(self, _dict):
        """Arguments:
            parent_id --- int type, 0 means root
        """
        Model.__init__(self, _dict)
        
        self.name = _dict['name']
        self.description = _dict['description']
        
        # Self associate field
        self.parent = _dict['parent']
        

    def __repr__(self):
        return '<Category %r>' % (self.name)

if __name__ == '__main__':
    # create table
    pass